<template>
	<view>
		<view class="order-content">
			<!-- 主任务信息 -->
			<view style="margin-bottom: 40rpx;">
				<view class="detail-title">
					<text>验房信息</text>
				</view>
				<view v-if="checkDetail.roomName" class="content-item">
					<text class="item-name">检查地址：</text>
					<view class="right-content">{{ checkDetail.roomName }}</view>
				</view>
				<view v-if="checkDetail.inspectTime" class="content-item">
					<text class="item-name">验房日期：</text>
					<view class="right-content">{{ checkDetail.inspectTime | formatTime }}</view>
				</view>
				<view v-if="checkDetail.inspectUnit" class="content-item">
					<text class="item-name">验房单位：</text>
					<view class="right-content">{{ checkDetail.inspectUnit }}</view>
				</view>
				<view v-if="checkDetail.inspectWorkerName" class="content-item">
					<text class="item-name">验房人员：</text>
					<view class="right-content">{{ checkDetail.inspectWorkerName }}</view>
				</view>
				<view v-if="checkDetail.waterMeter" class="content-item">
					<text class="item-name">水表底数：</text>
					<view class="right-content">{{ checkDetail.waterMeter }}次</view>
				</view>
				<view class="content-item">
					<text class="item-name">电表底数：</text>
					<view class="right-content">{{ checkDetail.powerMeter }}</view>
				</view>
				<view v-if="checkDetail.inspectCompany" class="content-item">
					<text class="item-name">陪验人：</text>
					<view class="right-content">{{ checkDetail.inspectCompany }}</view>
				</view>
				<view v-if="checkDetail.carPosition" class="content-item">
					<text class="item-name">车位号：</text>
					<view class="right-content">{{ checkDetail.carPosition }}</view>
				</view>
				<view v-if="checkDetail.inspectCompany" class="content-item">
					<text class="item-name">验房描述：</text>
					<view class="right-content">{{ checkDetail.remark }}</view>
				</view>
				<image-viewer :imageWidth="220" v-model="checkDetail.inspectAccessory"></image-viewer>
					
			</view>
			

		</view>

	</view>
</template>

<script>
	import imageViewer from '@/myComponents/imageViewer.vue'
	export default {
		components: {
			imageViewer
		},
		data() {
			return {
				checkDetail: {}
			}
		},
		onLoad(options) {
			this.getCheckDetail(+options.id)
		},
		methods: {
			getCheckDetail(id) {
				uni.showLoading()
				this.$http.post('/checkin/inspect/info', {
					id
				}).then(res => {
					if (res.code === 10000) {
						res.data.inspectAccessory = res.data.inspectAccessory.split(',')
						this.checkDetail = res.data
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	@import '../../style/info.scss';
</style>
